package training.sample.app.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import training.sample.app.domain.Country;
import training.sample.app.repository.CountryDao;
import training.sample.app.service.CountryService;

@Service
@Transactional
public class CountryServiceImpl implements CountryService {
	
	@Autowired
	private CountryDao countryRepository;

	@Override
	public Country getCountryByID(Long countryId) {
		return countryRepository.findById(countryId);
	}

	@Override
	public List<Country> getCountries() {
		return countryRepository.findAll();
	}

	
}

